
import Log4R from "shared/component/log/Log4R";

import { aninmClient, characterStateClient, move2DClient } from "./clientLib";
import { CharacterState } from "shared/enums/CharacterState";

const loginfo = Log4R.getLog('info')
/** 状态服务 */


/* 角色状态改变 */
characterStateClient.onStateChange((state, character) => {
    // loginfo?.info('onStateChange:', state)
    loginfo?.info('actStates', state.state && CharacterState[state.state.actStates])
    move2DClient.changeColli(state.state?.actStates as CharacterState, character)
    move2DClient.resetForce(character)
    move2DClient.setTurnEnable(character, state.state?.currentState?.turnEnable || false)
    aninmClient.changeState(state, character)
})
